package com.ruitu.mall_98_2.mvp.model;

import com.ruitu.mall_98_2.dao.APIRetrofit;
import com.ruitu.mall_98_2.mvp.contract.AccountSettingContract;
import com.ruitu.router_module.bean.api.BaseResult;

import okhttp3.MultipartBody;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class AccountSettingModel implements AccountSettingContract.Model {
    @Override
    public Observable<BaseResult> updateUserHead(MultipartBody multipartBody) {
        return APIRetrofit.getDefault().updateUserHead(multipartBody)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<BaseResult> updateUserInfo(String id, String nickName, String sex) {
        return APIRetrofit.getDefault().updateUserInfo(id, nickName, sex)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }
}
